using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Package
{
    /// <summary>
    /// <para>Create Vector Tile Package</para>
    /// <para>Generates vector tiles from a map or basemap and packages the tiles in a single .vtpk file.</para>
    /// <para>从地图或底图生成矢量切片，并将切片打包到单个 .vtpk 文件中。</para>
    /// </summary>    
    [DisplayName("Create Vector Tile Package")]
    public class CreateVectorTilePackage : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateVectorTilePackage()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_map">
        /// <para>Input Map</para>
        /// <para>The map from which tiles are generated and packaged. The input map must have metadata description and tags.</para>
        /// <para>从中生成和打包切片的地图。输入地图必须具有元数据描述和标记。</para>
        /// </param>
        /// <param name="_output_file">
        /// <para>Output File</para>
        /// <para>The output vector tile package. The file extension of the package is .vtpk.</para>
        /// <para>输出矢量切片包。该包的文件扩展名为 .vtpk。</para>
        /// </param>
        /// <param name="_service_type">
        /// <para>Package for ArcGIS Online | Bing Maps | Google Maps</para>
        /// <para><xdoc>
        ///   <para>Determines whether the tiling scheme will be generated from an existing map service or if map tiles will be generated for ArcGIS Online, Bing Maps, and Google Maps.
        ///   <bulletList>
        ///     <bullet_item>Checked—The ArcGIS Online/Bing Maps/Google Maps tiling scheme is used. The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay your cache tiles with tiles from these online mapping services. ArcGIS Pro includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this tiling scheme, the data frame of your source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Tiling scheme from an existing vector tile service will be used. Only tiling schemes with scales that double in progression through levels and have 512-by-512 tile size are supported. You must specify a vector tile service or tiling scheme file in the tiling_scheme parameter.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>确定是根据现有地图服务生成切片方案，还是为 ArcGIS Online、Bing 地图和 Google 地图生成地图切片。
        ///   <bulletList>
        ///     <bullet_item>选中 - 使用 ArcGIS Online/Bing 地图/Google 地图切片方案。ArcGIS Online/Bing 地图/Google 地图切片方案允许您使用这些在线制图服务中的切片叠加缓存切片。加载切片方案时，ArcGIS Pro 会将此切片方案作为内置选项包括在内。选择此切片方案时，源地图的数据框必须使用 WGS 1984 Web 墨卡托（辅助球体）投影坐标系。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中—将使用现有矢量切片服务中的切片方案。仅支持比例在关卡中翻倍且切片大小为 512 x 512 的切片方案。必须在 tiling_scheme 参数中指定矢量切片服务或切片方案文件。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_min_cached_scale">
        /// <para>Minimum Cached Scale</para>
        /// <para>The minimum (smallest) scale at which tiles are generated. This does not have to be the smallest scale in your tiling scheme. The minimum cached scale determines which scales are used to generate cache.</para>
        /// <para>生成切片的最小（最小）比例。这不一定是切片方案中的最小比例。最小缓存比例决定了用于生成缓存的比例。</para>
        /// </param>
        /// <param name="_max_cached_scale">
        /// <para>Maximum Cached Scale</para>
        /// <para>The maximum (largest) scale at which tiles are generated. This does not have to be the largest scale in your tiling scheme. The maximum cached scale determines which scales are used to generate cache.</para>
        /// <para>生成切片的最大（最大）比例。这不一定是切片方案中的最大比例。最大缓存比例决定了用于生成缓存的比例。</para>
        /// </param>
        public CreateVectorTilePackage(object _in_map, object _output_file, _service_type_value _service_type, double? _min_cached_scale, double? _max_cached_scale)
        {
            this._in_map = _in_map;
            this._output_file = _output_file;
            this._service_type = _service_type;
            this._min_cached_scale = _min_cached_scale;
            this._max_cached_scale = _max_cached_scale;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Vector Tile Package";

        public override string CallName => "management.CreateVectorTilePackage";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_map, _output_file, _service_type.GetGPValue(), _tiling_scheme, _tile_structure.GetGPValue(), _min_cached_scale, _max_cached_scale, _index_polygons, _summary, _tags];

        /// <summary>
        /// <para>Input Map</para>
        /// <para>The map from which tiles are generated and packaged. The input map must have metadata description and tags.</para>
        /// <para>从中生成和打包切片的地图。输入地图必须具有元数据描述和标记。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Map")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_map { get; set; }


        /// <summary>
        /// <para>Output File</para>
        /// <para>The output vector tile package. The file extension of the package is .vtpk.</para>
        /// <para>输出矢量切片包。该包的文件扩展名为 .vtpk。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_file { get; set; }


        /// <summary>
        /// <para>Package for ArcGIS Online | Bing Maps | Google Maps</para>
        /// <para><xdoc>
        ///   <para>Determines whether the tiling scheme will be generated from an existing map service or if map tiles will be generated for ArcGIS Online, Bing Maps, and Google Maps.
        ///   <bulletList>
        ///     <bullet_item>Checked—The ArcGIS Online/Bing Maps/Google Maps tiling scheme is used. The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay your cache tiles with tiles from these online mapping services. ArcGIS Pro includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this tiling scheme, the data frame of your source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Tiling scheme from an existing vector tile service will be used. Only tiling schemes with scales that double in progression through levels and have 512-by-512 tile size are supported. You must specify a vector tile service or tiling scheme file in the tiling_scheme parameter.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>确定是根据现有地图服务生成切片方案，还是为 ArcGIS Online、Bing 地图和 Google 地图生成地图切片。
        ///   <bulletList>
        ///     <bullet_item>选中 - 使用 ArcGIS Online/Bing 地图/Google 地图切片方案。ArcGIS Online/Bing 地图/Google 地图切片方案允许您使用这些在线制图服务中的切片叠加缓存切片。加载切片方案时，ArcGIS Pro 会将此切片方案作为内置选项包括在内。选择此切片方案时，源地图的数据框必须使用 WGS 1984 Web 墨卡托（辅助球体）投影坐标系。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中—将使用现有矢量切片服务中的切片方案。仅支持比例在关卡中翻倍且切片大小为 512 x 512 的切片方案。必须在 tiling_scheme 参数中指定矢量切片服务或切片方案文件。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Package for ArcGIS Online | Bing Maps | Google Maps")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _service_type_value _service_type { get; set; }

        public enum _service_type_value
        {
            /// <summary>
            /// <para>ONLINE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ONLINE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>EXISTING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXISTING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Tiling scheme</para>
        /// <para>A vector tile service or tiling scheme file to be used if the Package for ArcGIS Online | Bing Maps | Google Maps parameter is unchecked. The tiling scheme tile size must be 512 by 512 and must have consecutive scales in a ratio of two.</para>
        /// <para>如果 Package for ArcGIS Online |必应地图 |Google 地图参数未选中。切片方案切片大小必须为 512 x 512，并且必须具有以 2 的比例连续的比例。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tiling scheme")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _tiling_scheme { get; set; } = null;


        /// <summary>
        /// <para>Tiling Format</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the tile generation structure is optimized with an indexed structure or as a flat array of all tiles at all levels of detail. The optimized indexed structure is the default and results in a smaller cache.</para>
        ///   <bulletList>
        ///     <bullet_item>Indexed—Produce tiles based on an index of feature density that optimizes the tile generation and file sizes. This is the default.</bullet_item><para/>
        ///     <bullet_item>Flat—Produce regular tiles for each level of detail without regard to feature density. This cache is larger than that produced with an indexed structure.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定切片生成结构是使用索引结构进行优化，还是作为所有细节级别的所有切片的平面数组进行优化。优化的索引结构是默认结构，并导致较小的缓存。</para>
        ///   <bulletList>
        ///     <bullet_item>索引 - 根据要素密度索引生成切片，以优化切片生成和文件大小。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>平面 - 为每个细节级别生成常规切片，而不考虑要素密度。此缓存大于使用索引结构生成的缓存。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tiling Format")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _tile_structure_value _tile_structure { get; set; } = _tile_structure_value._INDEXED;

        public enum _tile_structure_value
        {
            /// <summary>
            /// <para>Indexed</para>
            /// <para>Indexed—Produce tiles based on an index of feature density that optimizes the tile generation and file sizes. This is the default.</para>
            /// <para>索引 - 根据要素密度索引生成切片，以优化切片生成和文件大小。这是默认设置。</para>
            /// </summary>
            [Description("Indexed")]
            [GPEnumValue("INDEXED")]
            _INDEXED,

            /// <summary>
            /// <para>Flat</para>
            /// <para>Flat—Produce regular tiles for each level of detail without regard to feature density. This cache is larger than that produced with an indexed structure.</para>
            /// <para>平面 - 为每个细节级别生成常规切片，而不考虑要素密度。此缓存大于使用索引结构生成的缓存。</para>
            /// </summary>
            [Description("Flat")]
            [GPEnumValue("FLAT")]
            _FLAT,

        }

        /// <summary>
        /// <para>Minimum Cached Scale</para>
        /// <para>The minimum (smallest) scale at which tiles are generated. This does not have to be the smallest scale in your tiling scheme. The minimum cached scale determines which scales are used to generate cache.</para>
        /// <para>生成切片的最小（最小）比例。这不一定是切片方案中的最小比例。最小缓存比例决定了用于生成缓存的比例。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Cached Scale")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _min_cached_scale { get; set; }


        /// <summary>
        /// <para>Maximum Cached Scale</para>
        /// <para>The maximum (largest) scale at which tiles are generated. This does not have to be the largest scale in your tiling scheme. The maximum cached scale determines which scales are used to generate cache.</para>
        /// <para>生成切片的最大（最大）比例。这不一定是切片方案中的最大比例。最大缓存比例决定了用于生成缓存的比例。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Cached Scale")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _max_cached_scale { get; set; }


        /// <summary>
        /// <para>Index Polygons</para>
        /// <para>Specifies a pregenerated index of tiles based on feature density, applicable only when the Tiling Format parameter is Indexed. Use the Create Vector Tile Index tool to create index polygons. If no index polygons are specified in this parameter, optimized index polygons are generated during processing to aid in tile creation, but they are not saved or output.</para>
        /// <para>指定基于要素密度的切片预生成索引，仅当切片格式参数为索引时才适用。使用创建矢量切片索引工具创建索引面。如果在此参数中未指定索引面，则在处理过程中会生成优化的索引面以帮助创建切片，但不会保存或输出这些面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Index Polygons")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _index_polygons { get; set; } = null;


        /// <summary>
        /// <para>Summary</para>
        /// <para>Adds summary information to properties of the output vector tile package.</para>
        /// <para>将摘要信息添加到输出矢量切片包的属性中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary { get; set; } = null;


        /// <summary>
        /// <para>Tags</para>
        /// <para>Adds tag information to the properties of the output vector tile package. Separate multiple tags with commas or semicolons.</para>
        /// <para>将标签信息添加到输出矢量切片包的属性中。用逗号或分号分隔多个标签。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tags")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _tags { get; set; } = null;


        public CreateVectorTilePackage SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}